<template>
 <lay-layout class="Pop">

  <lay-body class="flexrow">
    <lay-form   v-for="(item, index) in deptList" :key="index" >
        
         <lay-form-item :label-width="0" @click="select(item)" 
         >
             <div class="item" >
              {{item.Name}}
             </div>
           </lay-form-item>
    </lay-form>

    </lay-body>
    <lay-footer>
     
      <lay-button size="sm" type="primary" @click="toSubmit"
            >保存</lay-button
          >
          <lay-button size="sm" @click="toCancel" style="margin-left:40px;">取消</lay-button>
    </lay-footer>
  </lay-layout>

</template>

<script lang="ts">
import { ref, watch,reactive,onMounted,h } from 'vue'
import { layer } from '@layui/layer-vue'
import MyHttp from "../../library/MyHttp";  
import MyWin from "../../library/MyWin"; 
import MyPage from "../../library/MyPage"; 
import {MyExcel} from "../../library/MyExcel"; 
import {MySimpleExport,TableColumn} from "../../library/MySimpleExport"; 
import MyData from "../../library/MyData";  
import MyImgUpOne from "../component/MyImgUpOne.vue";  

export default {
  props:{
      data:Object 
  },
  components: {  MyImgUpOne },

  setup(prop:any, context:any) {
    const baseUrl="/htuser";
    const myWin=ref<any>(null);
    const deptList = ref<any>(prop.data )
    const select=(item:any)=>{ 
      context.emit("ok",item); 
      myWin.value.close();
    }   
    const toSubmit=async()=>{
       
    } 
    const toCancel=()=>{ 
      context.emit("cancel");  
      myWin.value.close();
    }
     
     
 
     
    onMounted(() =>{  
      myWin.value=new MyWin();
       
      
    });
    return {
      deptList,
      select,
      toSubmit,
      toCancel, 
 

    }
  }
}
</script>
<style scoped>
.Pop .layui-footer,
.Pop .layui-header {
  height: 50px;
  text-align: center; 
  padding-top:10px;
}  
.Pop .layui-body{
  justify-content:start;
}
.item{
  text-align: center;
  cursor: pointer;

}  
</style>